.section .XORS
XORED_TABLE:
.byte 0x5b,0xc2,0xb6,0x3e,0x67,0x29,0xc7,0x9a,0x9e,0x13,0x5a,0xe9,0xab,0x21,0xda,0xb5
.byte 0x89,0x76,0xa7,0x49,0x64,0x2a,0x46,0x56,0xfc,0x23,0x4d,0xd7,0xa1,0x08,0x57,0x19
.byte 0x80,0x2b,0x71,0x3f,0xcc,0x0e,0x4b,0x76,0xef,0x83,0x8b,0x1d,0xdd,0x5c,0xee,0x1e
.byte 0x2b,0xe7,0xed,0x68,0x26,0x40,0x4d,0x7f,0xef,0x37,0xc4,0x96,0x01,0x58,0x7f,0x0d
.byte 0x22,0xb9,0x69,0x33,0x57,0x71,0x3f,0xcc,0x1f,0x42,0x78,0xf8,0xa0,0xe2,0xf5,0x73
.byte 0x44,0xb9,0x6a,0x24,0x41,0xcb,0x38,0xc3,0x21,0xd0,0x9d,0x04,0x53,0xf5,0x3f,0xcb
.byte 0x32,0xdd,0xbd,0x05,0x5b,0xdc,0x24,0xca,0x36,0xa9,0x8a,0x10,0x1f,0x51,0xfb,0x94
.byte 0x86,0x85,0xb1,0x12,0x58,0x70,0xfd,0xaa,0x82,0x85,0x91,0x13,0x50,0x59,0xe6,0xab
.byte 0x86,0xf1,0x56,0x67,0x29,0xc7,0x88,0x99,0x13,0x49,0xe4,0x98,0x08,0xdf,0xac,0x81
.byte 0x13,0x72,0xf3,0xa8,0x08,0xc1,0xb4,0x8d,0x02,0x52,0xf2,0xa0,0x21,0xda,0xb5,0x89
.byte 0x76,0xbf,0xc9,0x41,0x0c,0x2f,0x61,0xe3,0x9a,0x90,0x97,0x0b,0xc5,0x1a,0x46,0xe5
.byte 0xae,0x86,0x86,0x16,0xce,0x27,0x69,0xfe,0xa7,0x80,0xf2,0xaf,0x47,0x09,0xd7,0x80
.byte 0x9d,0x11,0x48,0x64,0xdd,0x22,0xc0,0xa5,0x81,0x1b,0x54,0x1d,0x2a,0x60,0x2e,0x44
.byte 0x5b,0x7e,0x63,0x62,0xf5,0xa5,0x33,0x55,0x7b,0x78,0x6f,0x6c,0xef,0xc0,0x61,0x22
.byte 0x75,0x3b,0xce,0x10,0xcf,0x27,0xfd,0xbc,0x8f,0x02,0xf5,0x3b,0xfd,0x32,0xc8,0xa1
.byte 0x83,0x1a,0xd4,0x5d,0xc9,0xe9,0xcb,0x0c,0x1c,0x80,0xce,0x34,0x75,0x7e,0x65,0x65
.byte 0x72,0x57,0xe9,0x25,0x57,0x5f,0x6e,0x57,0x67,0x62,0xf4,0x29,0x4f,0x7e,0x08,0x33
.byte 0x6b,0x5c,0x12,0x5a,0x46,0xfe,0xa0,0x90,0x08,0xf9,0x28,0x5a,0x65,0xe2,0xa7,0x97
.byte 0x05,0xdd,0x2f,0x68,0x7e,0xe7,0xa0,0xe2,0xe4,0x5b,0x15,0xd9,0x95,0x19,0xd0,0xbb
.byte 0x19,0xd3,0x10,0xc8,0xaf,0x6b,0x3f,0x99,0xfb,0xa5,0xe7,0x2b,0x65,0xe1,0x85,0x15
.byte 0xd7,0x37,0xe7,0x33,0x52,0x95,0x36,0xfc,0x63,0x51,0x1f,0xdc,0x07,0x4f,0x61,0xdc
.byte 0x24,0xce,0x24,0xcd,0x1f,0x4f,0x6c,0x8a,0x82,0x1c,0x1a,0x7b,0x8e,0x4d,0x03,0xd2
.byte 0x02,0xdc,0xb1,0x18,0x4c,0xd1,0x28,0xdf,0x53,0x6e,0xee,0x79,0x53,0xd0,0x38,0x76
.byte 0x68,0x5f,0x72,0xe6,0xb3,0x99,0x26,0x59,0x70,0x7b,0x62,0xc8,0xa4,0x99,0x70,0x85
.byte 0x92,0x91,0x92,0x1f,0x77,0x39,0xcf,0x98,0x80,0x02,0xd6,0xb8,0x9c,0x16,0xcf,0xb8
.byte 0xa5,0x12,0xc2,0xdd,0xd0,0xe7,0x58,0x77,0x39,0xcf,0x98,0x80,0x02,0xd6,0xb8,0x9c
.byte 0x16,0xcf,0xb8,0xb8,0x16,0xd7,0xa8,0x8b,0x3c,0xde,0xa4,0xee,0xe4,0x52,0xe9,0x5a
.byte 0x70,0x3e,0x4c,0x53,0x7e,0x62,0xed,0x8a,0x85,0x09,0x7d,0x64,0x0e,0xd4,0x46,0xe1
.byte 0x3e,0x64,0x68,0xc1,0xa8,0x97,0x98,0x9e,0x05,0x7d,0x77,0xee,0xa9,0x84,0x94,0xb5
.byte 0x09,0x52,0x6b,0xe6,0xb7,0x8f,0x94,0xb3,0x19,0x47,0x6c,0x8f,0x9b,0x90,0x5f,0x36
.byte 0x6c,0x6c,0xc3,0xa9,0x17,0xd8,0xbe,0x15,0x75,0x73,0xec,0xa8,0x04,0xd4,0x93,0x09
.byte 0x4f,0x1b,0x4a,0x5e,0x3f,0x0d,0x43,0xf2,0x12,0xd4,0xb5,0x1a,0x4d,0x5c,0x78,0xea
.byte 0x2f,0xe0,0xa4,0x1c,0x46,0x73,0x6f,0xf3,0x37,0xc4,0xa3,0x2e,0x5d,0x76,0x68,0x86
.byte 0x55,0x9f,0x39,0x77,0xe8,0x0a,0x42,0xff,0xac,0x90,0x17,0x72,0xf9,0x37,0x27,0x55
.byte 0x5b,0xe1,0xae,0x65,0x2b,0xc6,0x1d,0xc9,0x3a,0x4e,0xe1,0xaf,0x33,0xd3,0x35,0xd9
.byte 0x33,0x60,0xf0,0xb3,0x65,0x23,0x02,0x67,0x29,0xc7,0x9d,0x99,0x06,0x57,0xf4,0xad
.byte 0x06,0xc7,0xbc,0xa3,0x14,0x51,0xf8,0xad,0x13,0xb3,0x08,0x73,0x3d,0xcd,0x8d,0x1b
.byte 0x52,0xe9,0xb4,0xaf,0x1d,0xdf,0xb3,0x1c,0x5a,0xfa,0xb9,0x8f,0x1c,0xd7,0x8c,0x1c
.byte 0x58,0xf8,0xa8,0x95,0x00,0xb9,0x3e,0x8e,0x83,0xd1,0xb5,0x8c,0x33,0x4a,0x79,0x6f
.byte 0x73,0xe6,0x80,0x83,0x04,0x51,0x6a,0x6f,0x73,0xea,0xae,0x8e,0x33,0x57,0x72,0x7a
.byte 0x62,0xfb,0xb5,0xe0,0x09,0x5c,0x01,0xdb,0xfd,0x31,0x7f,0xec,0x1d,0x53,0x76,0xfb
.byte 0xbd,0x31,0x54,0xfb,0x39,0x54,0x7a,0xfd,0xbd,0x2d,0x53,0xf2,0x29,0x45,0x67,0x89
.byte 0x35,0x07,0xb6,0x99,0x44,0x0a,0x56,0x5f,0xe7,0x30,0x4b,0x77,0xf1,0x07,0x4a,0x70
.byte 0xe6,0x23,0x47,0x55,0xe1,0x36,0x47,0x72,0xfc,0x2b,0x50,0x68,0xce,0x2d,0x4e,0x74
.byte 0x88,0xf6,0x32,0x30,0xa0,0x0c,0x24,0x76,0x66,0x65,0xc5,0x26,0x45,0xc2,0x2d,0x42
.byte 0x53,0x6a,0xf0,0x2b,0x57,0xf1,0x3c,0x4d,0x7d,0x67,0xc7,0x2d,0x4f,0xe4,0x2d,0x5c
.byte 0x66,0x09,0xd0,0x55,0x7d,0x2f,0xca,0x33,0xfd,0xb2,0x87,0x90,0x9b,0x0e,0xdb,0x1e
.byte 0xcc,0xa3,0x82,0x83,0x9b,0x09,0xd7,0x30,0xc1,0x94,0x84,0x9b,0x8e,0x18,0xc6,0x2b
.byte 0xaf,0x01,0x7d,0x2f,0xca,0x33,0xee,0xb4,0x9f,0x9c,0x8c,0x1c,0xca,0x3a,0xee,0xb4
.byte 0x9f,0x9c,0x8c,0x1c,0xca,0x36,0xc0,0xb9,0xa8,0x9a,0x94,0x09,0xdb,0x27,0xdb,0xd7
.byte 0x1a,0xbc,0xbb,0x3f,0x20,0x72,0x64,0x64,0x40,0x67,0x60,0xe3,0x34,0x49,0x66,0x69
.byte 0x70,0x67,0x40,0xe3,0x34,0x49,0x66,0x69,0x70,0x6b,0x6e,0xee,0x03,0x4f,0x7e,0x7c
.byte 0x61,0x7a,0x75,0x80,0x96,0xe7,0x85,0x20,0x72,0x64,0x64,0x42,0x70,0x64,0xe5,0x14
.byte 0x48,0x62,0x6d,0x65,0x66,0x40,0xe3,0x34,0x49,0x66,0x69,0x70,0x6b,0x6e,0xee,0x03
.byte 0x4f,0x7e,0x7c,0x61,0x7a,0x75,0xd3,0x34,0x41,0x73,0x63,0x04,0x83,0x0d,0x5f,0xf2
.byte 0x2f,0xe6,0xb5,0x1c,0x75,0x79,0x79,0xef,0x35,0xc4,0x91,0x0b,0x40,0x73,0x7b,0xe7
.byte 0x37,0xc8,0xbf,0x06,0x77,0x75,0x63,0xf2,0x26,0xd9,0xa4,0x68,0xb4,0x5a,0x08,0x59
.byte 0xfa,0x02,0xd6,0x93,0x0a,0xc0,0x33,0x5b,0xf7,0x3f,0xcc,0xbd,0x07,0xf7,0x35,0x43
.byte 0xe2,0x2e,0xdd,0xa6,0x28,0xd7,0x2e,0x44,0xe0,0x2e,0xa5,0x82,0x67,0x83,0xac,0x51
.byte 0x29,0x7b,0xe0,0x26,0x74,0xe7,0x2c,0xd6,0x2b,0x60,0xfa,0x2c,0x4a,0xe0,0x24,0xc5
.byte 0x26,0x40,0xfb,0x24,0x64,0xf1,0x3d,0xcd,0x24,0x48,0xe0,0x23,0x4a,0xfc,0x0a,0xcb
.byte 0x3c,0x5d,0xf1,0x32,0x51,0x92,0x1e,0xe7,0xdd,0x63,0x31,0xc5,0xb4,0x2a,0x5f,0x75
.byte 0xe9,0x87,0x00,0xc5,0xb1,0x1a,0x57,0x6f,0xe4,0xa9,0x0d,0xf2,0xb7,0x02,0x42,0x7e
.byte 0xf5,0xb2,0x30,0xd4,0xbb,0x18,0x5f,0x74,0xe3,0x95,0x17,0xc3,0xb1,0x02,0x51,0x1b
.byte 0xb4,0xb1,0xdc,0x6b,0x28,0xc6,0xa8,0x2e,0xda,0x32,0xc8,0xb8,0x1f,0xf6,0xbb,0x01
.byte 0xda,0x08,0xc8,0xa4,0x1d,0xd0,0xa8,0x6d,0x09,0xbc,0x5e,0x57,0x19,0xdf,0x99,0x85
.byte 0x16,0xd1,0x1b,0xc7,0x3b,0xce,0xd5,0xde,0x03,0xb2,0x0d,0x0c,0x37,0x79,0xef,0x98
.byte 0x88,0x1f,0xd6,0xbf,0x05,0x71,0xf2,0xa1,0x83,0x73,0x0a,0xd9,0x27,0x64,0xe1,0xac
.byte 0x85,0x06,0x5c,0xdd,0x2d,0x53,0xd0,0xbd,0x9c,0x25,0x39,0x66,0xa4,0x44,0x03,0x47
.byte 0x65,0xcd,0x2a,0x54,0x78,0xfa,0x2b,0x4c,0x7c,0xed,0x2a,0x56,0x47,0xe9,0x36,0x4b
.byte 0x70,0xea,0x28,0x47,0x46,0x88,0x45,0x8c,0x6b,0x28,0xc7,0xbf,0x0c,0xc2,0x3e,0xfd
.byte 0xa4,0x04,0xd6,0xbf,0x1e,0xc5,0x1a,0xad,0xc0,0xfc,0xe3,0x2a,0x69,0x67,0xef,0x24
.byte 0xd6,0x34,0xf8,0x26,0x45,0x76,0xef,0x36,0xd1,0x06,0xa8,0x8d,0x80,0x86,0x4f,0x18
.byte 0xce,0xbd,0xac,0x8c,0x1f,0x5e,0x9e,0x15,0x09,0x4e,0xe1,0x36,0x62,0xff,0x25,0x49
.byte 0x73,0x67,0xe0,0x0e,0x48,0xfe,0x2d,0x65,0x12,0xd7,0x6a,0x2d,0x50,0xee,0x0e,0xc9
.byte 0x3e,0xc4,0xb5,0x04,0x51,0xd6,0x24,0xc8,0x36,0xfe,0xd4

.align 4
.long 0

.global __UnXOr
__UnXOr:
    mov     12(%esp),%eax

__UnXOr_buffer:
    push    %esi
    push    %edi
    push    %ecx

    mov     %eax,%edi
    movl    16(%esp),%esi
    movl    $8953967,%eax
    xor     %eax,%esi
    sub     %eax,%esi
    and     $(0x0ffff),%esi

    call    __UnXOr_TABLE
__UnXOr_TABLE:
    pop     %eax
    sub     $(__UnXOr_TABLE-XORED_TABLE),%eax
    add     %eax,%esi
    movl    20(%esp),%ecx
    movl    (%esi),%eax
    incl    %esi
    push    %edi

__UnXOr_loop:
    movb    (%esi),%ah
    xorb    %al,%ah
    movb    %ah,(%edi)
    incl    %esi
    ror     $1,%al
    incl    %edi
    decl    %ecx
    jne     __UnXOr_loop

    pop     %eax
    pop     %ecx
    pop     %edi
    pop     %esi
    ret

